package com.activemq.common;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

@Component
public class Consumer {
    @JmsListener(destination = "tx_queue")
    private void receiveQueue(String msg){
        System.out.println("接收到消息："+msg);
    }

    @JmsListener(destination = "tx_topic")
    private void receiveTopic(String msg){
        System.out.println("接收到订阅消息："+msg);
    }
}
